use carpet::base::error::ServerError;
use thiserror::Error;

use crate::api::prelude::*;


#[text_dto]
pub struct RequestData {
    pub title: String,

    pub age: Option<i32>,

    pub description: Vec<String>,

}

#[text_dto]
pub struct ResponseData {
    pub title: String,

    pub age: Option<i32>,

    pub description: Vec<String>,
}

#[derive(Debug, Error, ApiError)]
pub enum Error {
    #[error(transparent)]
    Server(#[from] ServerError),
}

#[handler]
async fn _handle(self, data: Json<RequestData>) -> Result<ResponseData, Error>;
